/*
 *  shmemorytracker.h
 *  shaderz_v3
 *
 *  Created by Anjali on 3/23/11.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */

#ifndef __SH_MEMORY_TRACKER_H__
#define __SH_MEMORY_TRACKER_H__

// stl headers
#include <map>
#include <string>

#include "shdefs.h"

namespace shaderz
{
	class shObject;
	
	class shMemoryTracker
	{
	public:
		~shMemoryTracker();
		
		static void registerMemoryAllocation( shObject* InAllocatedMemory, size_t InSizeInBytes, bool InIsArray, std::string InFileName, int InLineNumber );
		static void unRegisterMemoryAllocation( shObject* InObjToFree );
	
	private:	
		struct MemAllocInfo
		{
			size_t		sizeInBytes;
			bool		isArray;
			std::string	fileName;
			int			lineNumber;
			
			MemAllocInfo()
				: sizeInBytes(0)
				, isArray(false)
				, fileName("")
				, lineNumber(0)
			{}
		};
		
		static std::map<void*, MemAllocInfo>	mAllocationRecords;
	};
}

#endif
